package per.turtle.system.feign.fallback;

import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import per.turtle.common.core.web.entity.CommonResult;
import per.turtle.system.entity.SysOperLog;
import per.turtle.system.feign.RemoteLogService;

/**
 * 日志服务降级处理
 *
 * @author turtle
 */
@Slf4j
@Component
public class RemoteLogFallbackImpl implements RemoteLogService {

    @Setter
    private Throwable cause;

    @Override
    public CommonResult<Boolean> saveLog(SysOperLog sysOperLog) {
        log.error("日志服务调用失败:{}", cause.getMessage());
        return null;
    }

    @Override
    public CommonResult<Boolean> saveLoginInfo(String username, String status, String message) {
        log.error("日志服务调用失败:{}", cause.getMessage());
        return null;
    }

}
